package com.yanqu.road.entity.relatives;

import com.yanqu.road.entity.DataObject;

import java.util.Objects;

public class RelativesInfo extends DataObject {
    private long userId1;
    private long userId2;
    private int marriageTimes;
    private int letterNum1;
    private int letterNum2;
    private short status;
    private String isShow;

    public boolean hasUserId(long userId) {
        if (this.userId1 == userId) {
            return true;
        }
        if (this.userId2 == userId) {
            return true;
        }
        return false;
    }
    public boolean hasUserId(long userId1, long userId2) {
        if (this.userId1 == userId1 && this.userId2 == userId2) {
            return true;
        }
        if (this.userId1 == userId2 && this.userId2 == userId1) {
            return true;
        }
        return false;
    }

    public long getUserId1() {
        return userId1;
    }

    public void setUserId1(long userId1) {
        if (userId1 != this.userId1) {
            this.userId1 = userId1;
            setUpdateOption();
        }
    }

    public long getUserId2() {
        return userId2;
    }

    public void setUserId2(long userId2) {
        if (userId2 != this.userId2) {
            this.userId2 = userId2;
            setUpdateOption();
        }
    }

    public int getMarriageTimes() {
        return marriageTimes;
    }

    public void setMarriageTimes(int marriageTimes) {
        if (marriageTimes != this.marriageTimes) {
            this.marriageTimes = marriageTimes;
            setUpdateOption();
        }
    }

    public short getStatus() {
        return status;
    }

    public void setStatus(short status) {
        if (status != this.status) {
            this.status = status;
            setUpdateOption();
        }
    }

    public int getLetterNum1() {
        return letterNum1;
    }

    public void setLetterNum1(int letterNum1) {
        if (letterNum1 != this.letterNum1) {
            this.letterNum1 = letterNum1;
            setUpdateOption();
        }
    }

    public int getLetterNum2() {
        return letterNum2;
    }

    public void setLetterNum2(int letterNum2) {
        if (letterNum2 != this.letterNum2) {
            this.letterNum2 = letterNum2;
            setUpdateOption();
        }
    }

    public String getIsShow() {
        return isShow;
    }

    public void setIsShow(String isShow) {
        if (!Objects.equals(this.isShow, isShow)) {
            this.isShow = isShow;
            setUpdateOption();
        }
    }
}
